#!/bin/sh

WORK_DIR=groovydoc

rm -rf $WORK_DIR

DIRS=`find . -maxdepth 2 -name "framework*"`
mkdir -p $WORK_DIR/src/main/java

echo "copy java and groovy sources ..."
for VAR in $DIRS
do
  if [ -e "$VAR/src/main/java/com" ] 
  then
    cp -rf $VAR/src/main/java/com $WORK_DIR/src/main/java
  fi
done

groovy makepom.groovy `pwd` `pwd`/$WORK_DIR

cd $WORK_DIR
mvn clean gplus:generateStubs gplus:groovydoc
